﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Microsoft Corp." file="IAzureServiceManagementClient.cs">
//   All rights reserved. See License.txt in the project root for license information.
// </copyright>
// 
// --------------------------------------------------------------------------------------------------------------------
namespace AzureManagement
{
    using System;
    using System.Collections.Generic;
    using System.Security.Cryptography.X509Certificates;
    using System.Threading.Tasks;

    using AzureManagement.AzureDataContracts;

    using RestClient;

    public interface IAzureServiceManagementClient
    {
        Task<string> CreateHostedService(
                                string name, 
                                string label, 
                                string description, 
                                string location, 
                                string affinityGroup, 
                                RequestOptions options = null);

        Task<IList<HostedService>> ListHostedServices(RequestOptions options = null);

        Task<HostedService> GetHostedServiceProperties(
                                            string serviceName, 
                                            bool embedDetails = false, 
                                            RequestOptions options = null);

        Task<string> DeleteHostedService(string serviceName, RequestOptions options = null);

        Task<string> CreateDeployment(
                                string serviceName, 
                                DeploymentSlots deploymentSlot, 
                                DeploymentDetails deploymentDetails, 
                                RequestOptions options = null);

        Task<Deployment> GetDeployment(string serviceName, string deploymentName, RequestOptions options = null);

        Task<Deployment> GetDeployment(
                                string serviceName, 
                                DeploymentSlots deploymentSlot, 
                                RequestOptions options = null);

        Task<string> DeleteDeployment(string serviceName, string deploymentName, RequestOptions options = null);

        Task<string> DeleteDeployment(string serviceName, DeploymentSlots deploymentSlot, RequestOptions options = null);

        Task<string> CreateStorageAccount(
                                    string name, 
                                    string description, 
                                    string label, 
                                    string affinityGroup, 
                                    string location, 
                                    bool geoReplication, 
                                    RequestOptions options = null);

        Task<IList<StorageService>> ListStorageAccounts(RequestOptions options = null);

        Task<StorageServiceKeys> GetStorageAccountKeys(string storageAccountName, RequestOptions options = null);

        Task<string> DeleteStorageAccount(string storageAccountName, RequestOptions options = null);

        Task<string> AddServiceCertificate(
                                string serviceName, 
                                X509Certificate2 certificate, 
                                string certificatePassword, 
                                RequestOptions options = null);

        Task<IList<Certificate>> ListServiceCertificates(string serviceName, RequestOptions options = null);

        Task<string> DeleteServiceCertificate(
                                    string serviceName, 
                                    string thumbprintAlg, 
                                    string thumbprint, 
                                    RequestOptions options = null);

        Task<Operation> GetOperationStatus(string operationId, RequestOptions options = null);

        Operation WaitOperationForCompletion(string operationId, TimeSpan timeout, RequestOptions options = null);
    }
}